<div class="row">
    <div class="col-md-12">       

        <div class="block">
            <div class="block-title">
                <h2><strong>Listado de Colegiados </strong> </h2>
            </div>

            <div class="table-responsive">
                <table id="tablacolegiados" class="table table-vcenter table-condensed table-bordered">
                    <thead>
                        <tr>
                            <th>Nro</th>
                            <th>Nombre</th>
                            <th>CI</th>
                            <th>RNI</th>
                            <th>Categoria</th>
                            <th>Acciones</th>
                        </tr>
                    </thead>
                    <tbody>
                        
                        
                    </tbody>
                </table>
            </div>

        </div>
    </div>    
</div>
<script>
    $(function() {
        TablesDatatables.init();
    });
    $(function() {
    // basic usage see app/Controllers/CitiesController::index
    $('#tablacolegiados').dataTable({
        "iDisplayLength": 10,
        "bProcessing": true,
        "bServerSide": true,
        "sAjaxSource": "<?php echo $this->Html->url(array('action' => 'colegiados.json'));?>",
        //"sDom": 'CRTfrtip'
"fnCreatedRow":function(nRow, aData, iDataIndex){
    if(aData[3]!=""){
        //color rows from 0-6
        for(var i=0; i<6; i++){
            $('td:eq('+i+')',nRow).css("backgroundColor","#F0FFF0");
        }
    }else{
        if(aData[3]==""){
            for(var i=0; i<6; i++){
                $('td:eq('+i+')',nRow).css("backgroundColor","#FFFAFA");
            }
        }
    }
}
    });
});

function elimina(idUser)
{
    if(confirm("Esta seguro de eliminar???"))
    {
        location = "<?php echo $this->Html->url(array('action' => 'delete'));?>/"+idUser;
    }
}
</script>